// 需要先下载插件：npm install --save js-cookie
import Cookies from 'js-cookie'
const TokenKey = 'tokenkey'
const TimeKey = 'tokentime'
const SidKey = 'sidkey'

export function getToken() {
    return Cookies.get(TokenKey)
}
export function setToken(token) {
    return Cookies.set(TokenKey, token)
}

export function getSid() {
    return Cookies.get(SidKey)
}
export function setSid(sid) {
    return Cookies.set(SidKey, sid)
}
export function removeToken() {
    return Cookies.remove(TokenKey)
}

// 获取时间戳
export function getTiemStamp() {
    return Cookies.get(TimeKey)
}
//设置时间戳
export function setTimeStamp() {
    Cookies.set(TimeKey, Date.now())
}